
arraypoint.o:     file format elf32-littlearm


Disassembly of section .text:

00000000 <v>:
	float a3[3]; float 数组,有3个元素，sizeof(float) * 3 = 12 个字节

	char a6[3]; char 数组,有3个元素，sizeof(char) * 3 = 3 个字节.
*/
void v()
{
   0:	e92d4800 	push	{fp, lr}
   4:	e28db004 	add	fp, sp, #4
   8:	e24dd018 	sub	sp, sp, #24
	char *p[5];
	
	printf("sizeof(*p[5]) = %d %d %d\n", sizeof(*p[4]), sizeof(p[4]), sizeof(p));	// 1 4 20
   c:	e3a03014 	mov	r3, #20 ; r3 = 20
  10:	e3a02004 	mov	r2, #4  ; r2 = 4
  14:	e3a01001 	mov	r1, #1  ; r1 = 1
  18:	e59f0008 	ldr	r0, [pc, #8]	; 28 <v+0x28>
  1c:	ebfffffe 	bl	0 <printf>
}
  20:	e24bd004 	sub	sp, fp, #4
  24:	e8bd8800 	pop	{fp, pc}
  28:	00000000 	.word	0x00000000

0000002c <array>:

int array(void)
{
  2c:	e92d4800 	push	{fp, lr}
  30:	e28db004 	add	fp, sp, #4
  34:	e24dd020 	sub	sp, sp, #32
	int zippo[4][2] = { {2,4}, {6, 8}, {1, 3}, {5, 7} };
  38:	e59f30e0 	ldr	r3, [pc, #224]	; 120 <array+0xf4>  variable value
  3c:	e24bc024 	sub	ip, fp, #36	; 0x24                  stack point
  40:	e1a0e003 	mov	lr, r3      ; lr = r3 = variable value
  44:	e8be000f 	ldm	lr!, {r0, r1, r2, r3} 
  48:	e8ac000f 	stmia	ip!, {r0, r1, r2, r3}
  4c:	e89e000f 	ldm	lr, {r0, r1, r2, r3}
  50:	e88c000f 	stm	ip, {r0, r1, r2, r3}

	printf(" zippo = %p\t, zippo + 1 = %p  %p\n", 	zippo, zippo + 1, &zippo[1][0]); // zippo + 1 换到下一行的首地址
  54:	e24b3024 	sub	r3, fp, #36	; 0x24  r3 = fp-36 = zippo = *zippo = zippo[0] = &zippo
  58:	e2830008 	add	r0, r3, #8  ;       r0 = zippo + 8, zipp0+1  ---> zippo[1]
  5c:	e24b3024 	sub	r3, fp, #36	; 0x24  r3 = zippo
  60:	e2832008 	add	r2, r3, #8  ;       r2 = zippo + 8, zippo+1  ---> zippo[1]
  64:	e24b1024 	sub	r1, fp, #36	; 0x24  r1 = zippo
  68:	e1a03000 	mov	r3, r0      ;       r3 = zippo + 8
  6c:	e59f00b0 	ldr	r0, [pc, #176]	; 124 <array+0xf8>
  70:	ebfffffe 	bl	0 <printf>
	printf(" zippo[0] = %p\t, zippo[0] + 1 = %p\n", zippo[0], zippo[0] + 1);		 // zippo[0] + 1 第一列的第二个元素地址
  74:	e24b3024 	sub	r3, fp, #36	; 0x24  zippo
  78:	e2832004 	add	r2, r3, #4  ;       zippo[0]+1
  7c:	e24b3024 	sub	r3, fp, #36	; 0x24  zippo
  80:	e1a01003 	mov	r1, r3      ;       zipo[0]
  84:	e59f009c 	ldr	r0, [pc, #156]	; 128 <array+0xfc>
  88:	ebfffffe 	bl	0 <printf>
	printf(" *zippo = %p\t, *zippo + 1 = %p\n\n", 	*zippo, *zippo + 1);			 // *zippo + 1 第一列的第二个元素地址
  8c:	e24b3024 	sub	r3, fp, #36	; 0x24  r3 = zippo
  90:	e2832004 	add	r2, r3, #4  ;       r2 = zippo+4 = *zippo+1
  94:	e24b3024 	sub	r3, fp, #36	; 0x24  r3 = zippo
  98:	e1a01003 	mov	r1, r3      ;       r1 = zippo
  9c:	e59f0088 	ldr	r0, [pc, #136]	; 12c <array+0x100>
  a0:	ebfffffe 	bl	0 <printf>
	printf(" &zippo = %p\n\n", 	&zippo);
  a4:	e24b3024 	sub	r3, fp, #36	; 0x24  zipp0
  a8:	e1a01003 	mov	r1, r3      ; r1 = zippo address
  ac:	e59f007c 	ldr	r0, [pc, #124]	; 130 <array+0x104>
  b0:	ebfffffe 	bl	0 <printf>
	
	printf(" zippo[0][0] = %d\n", 	zippo[0][0]);	// 2
  b4:	e51b3024 	ldr	r3, [fp, #-36]	; 0xffffffdc    [zippo]
  b8:	e1a01003 	mov	r1, r3
  bc:	e59f0070 	ldr	r0, [pc, #112]	; 134 <array+0x108>
  c0:	ebfffffe 	bl	0 <printf>
	printf(" *zippo[0] = %d\n", 	*zippo[0]);	// 2
  c4:	e51b3024 	ldr	r3, [fp, #-36]	; 0xffffffdc    [zippo]
  c8:	e1a01003 	mov	r1, r3
  cc:	e59f0064 	ldr	r0, [pc, #100]	; 138 <array+0x10c>
  d0:	ebfffffe 	bl	0 <printf>
	printf(" **zippo = %d\n", 	**zippo);	// 2
  d4:	e24b3024 	sub	r3, fp, #36	; 0x24  zippo
  d8:	e5933000 	ldr	r3, [r3]    ; r3 =  **zippo = zippo[0][0]
  dc:	e1a01003 	mov	r1, r3
  e0:	e59f0054 	ldr	r0, [pc, #84]	; 13c <array+0x110>
  e4:	ebfffffe 	bl	0 <printf>
	printf(" zippo[2][1] = %d\n", 	zippo[2][1]);	// 3
  e8:	e51b3010 	ldr	r3, [fp, #-16]          ; zippo[2][1]
  ec:	e1a01003 	mov	r1, r3
  f0:	e59f0048 	ldr	r0, [pc, #72]	; 140 <array+0x114>
  f4:	ebfffffe 	bl	0 <printf>
	printf(" *(*(zippo + 2) + 1) = %d\n", 	* ( * (zippo + 2) + 1));	// 3
  f8:	e24b3024 	sub	r3, fp, #36	; 0x24  zippo
  fc:	e2833014 	add	r3, r3, #20 ; r3 = zippo + 20
 100:	e5933000 	ldr	r3, [r3]    ; r3 = [r3] = zippo[2][1]
 104:	e1a01003 	mov	r1, r3
 108:	e59f0034 	ldr	r0, [pc, #52]	; 144 <array+0x118>
 10c:	ebfffffe 	bl	0 <printf>

	return 0;
 110:	e3a03000 	mov	r3, #0

}
 114:	e1a00003 	mov	r0, r3
 118:	e24bd004 	sub	sp, fp, #4
 11c:	e8bd8800 	pop	{fp, pc}
 120:	00000100 	.word	0x00000100
 124:	0000001c 	.word	0x0000001c
 128:	00000040 	.word	0x00000040
 12c:	00000064 	.word	0x00000064
 130:	00000088 	.word	0x00000088
 134:	00000098 	.word	0x00000098
 138:	000000ac 	.word	0x000000ac
 13c:	000000c0 	.word	0x000000c0
 140:	000000d0 	.word	0x000000d0
 144:	000000e4 	.word	0x000000e4

00000148 <array_point>:

int array_point(void)
{
 148:	e92d4800 	push	{fp, lr}
 14c:	e28db004 	add	fp, sp, #4
 150:	e24dd038 	sub	sp, sp, #56	; 0x38
	int zippo[4][2] = { {2,4}, {6, 8}, {1, 3}, {5, 7} };
 154:	e59f312c 	ldr	r3, [pc, #300]	; 288 <array_point+0x140>
 158:	e24bc028 	sub	ip, fp, #40	; 0x28  zippo
 15c:	e1a0e003 	mov	lr, r3
 160:	e8be000f 	ldm	lr!, {r0, r1, r2, r3}
 164:	e8ac000f 	stmia	ip!, {r0, r1, r2, r3}
 168:	e89e000f 	ldm	lr, {r0, r1, r2, r3}
 16c:	e88c000f 	stm	ip, {r0, r1, r2, r3}
	int (*pz)[2];
	int *pp[4];

	pz = zippo;
 170:	e24b3028 	sub	r3, fp, #40	; 0x28  zippo
 174:	e50b3008 	str	r3, [fp, #-8] ; pz = zippo
	pp = zippo[0][0];	// int *[4] from type int
	pp = &zippo[0][0];	// int *[4] from type int *
	pp = &zippo[0];		// int *[4] from type int (*)[2]
	pp = zippo[0];		// int *[4] from type int
*/
	pp[0] = &zippo[0];	  // warning 
 178:	e24b3028 	sub	r3, fp, #40	; 0x28              zippo
 17c:	e50b3038 	str	r3, [fp, #-56]	; 0xffffffc8    pp
	pp[0] = zippo[0];   
 180:	e24b3028 	sub	r3, fp, #40	; 0x28              zippo
 184:	e50b3038 	str	r3, [fp, #-56]	; 0xffffffc8    pp
	pp[0] = zippo[0][0];	// warning
 188:	e51b3028 	ldr	r3, [fp, #-40]	; 0xffffffd8    zippo
 18c:	e50b3038 	str	r3, [fp, #-56]	; 0xffffffc8    pp
	pp[0] = &zippo[0][0];
 190:	e24b3028 	sub	r3, fp, #40	; 0x28              zippo
 194:	e50b3038 	str	r3, [fp, #-56]	; 0xffffffc8    pp
	

	printf("&zippo = %p : %p\n", &zippo, &zippo[1][0]);	
 198:	e24b3028 	sub	r3, fp, #40	; 0x28  zippo
 19c:	e2832008 	add	r2, r3, #8  ;       r2 = zippo+8
 1a0:	e24b3028 	sub	r3, fp, #40	; 0x28  zippo
 1a4:	e1a01003 	mov	r1, r3
 1a8:	e59f00dc 	ldr	r0, [pc, #220]	; 28c <array_point+0x144>
 1ac:	ebfffffe 	bl	0 <printf>
	printf(" pz = %p\t, pz + 1 = %p\n", 		pz, pz + 1);		// 换到下一行的首地址
 1b0:	e51b3008 	ldr	r3, [fp, #-8]                      ; r3 = pz = zippo
 1b4:	e2833008 	add	r3, r3, #8                         ; r3 = pz + 8
 1b8:	e1a02003 	mov	r2, r3                             ; r2 = pz + 8
 1bc:	e51b1008 	ldr	r1, [fp, #-8]                      ; r1 = pz = zippo
 1c0:	e59f00c8 	ldr	r0, [pc, #200]	; 290 <array_point+0x148>
 1c4:	ebfffffe 	bl	0 <printf>
	printf(" pz[0] = %p\t, pz[0] + 1 = %p\n", 	pz[0], pz[0] + 1);	// 第一列的第二个元素地址
 1c8:	e51b3008 	ldr	r3, [fp, #-8]                            ; r3 = pz
 1cc:	e2833004 	add	r3, r3, #4                               ; r3 = pz + 4
 1d0:	e1a02003 	mov	r2, r3                                   ; r2 = pz + 4
 1d4:	e51b1008 	ldr	r1, [fp, #-8]                            ; r1 = pz
 1d8:	e59f00b4 	ldr	r0, [pc, #180]	; 294 <array_point+0x14c>
 1dc:	ebfffffe 	bl	0 <printf>
	printf(" *pz = %p\t, *pz + 1 = %p\n", 		*pz, *pz + 1);		// 第一列的第二个元素地址
 1e0:	e51b3008 	ldr	r3, [fp, #-8]                        ; r3 = pz
 1e4:	e2833004 	add	r3, r3, #4                           ; r3 = pz + 4
 1e8:	e1a02003 	mov	r2, r3                               ; r2 = pz + 4
 1ec:	e51b1008 	ldr	r1, [fp, #-8]                        ; pz 
 1f0:	e59f00a0 	ldr	r0, [pc, #160]	; 298 <array_point+0x150>
 1f4:	ebfffffe 	bl	0 <printf>
	printf(" pz[1] = %p\n\n", 		pz[1]);							// 换到下一行的首地址
 1f8:	e51b3008 	ldr	r3, [fp, #-8]     ; r3 = pz
 1fc:	e2833008 	add	r3, r3, #8        ; r3 = pz + 8
 200:	e1a01003 	mov	r1, r3            ; r1 = pz + 8
 204:	e59f0090 	ldr	r0, [pc, #144]	; 29c <array_point+0x154>
 208:	ebfffffe 	bl	0 <printf>
	
	printf(" pz[0][0] = %d\n", 			pz[0][0]);	// 2
 20c:	e51b3008 	ldr	r3, [fp, #-8]            ; r3 = pz
 210:	e5933000 	ldr	r3, [r3]                 ; r3 = [pz]
 214:	e1a01003 	mov	r1, r3
 218:	e59f0080 	ldr	r0, [pc, #128]	; 2a0 <array_point+0x158>
 21c:	ebfffffe 	bl	0 <printf>
	printf(" *pz[0] = %d\n", 			*pz[0]);	// 2
 220:	e51b3008 	ldr	r3, [fp, #-8]          ; r3 = pz
 224:	e5933000 	ldr	r3, [r3]               ; r3 = [pz]
 228:	e1a01003 	mov	r1, r3                 ; r1 = [pz]
 22c:	e59f0070 	ldr	r0, [pc, #112]	; 2a4 <array_point+0x15c>
 230:	ebfffffe 	bl	0 <printf>
	printf(" **pz = %d\n", 				**pz);		// 2
 234:	e51b3008 	ldr	r3, [fp, #-8]        ; pz
 238:	e5933000 	ldr	r3, [r3]             ; r3 = [pz]
 23c:	e1a01003 	mov	r1, r3               ; r1 = [pz]
 240:	e59f0060 	ldr	r0, [pc, #96]	; 2a8 <array_point+0x160>
 244:	ebfffffe 	bl	0 <printf>
	printf(" pz[2][1] = %d\n",			pz[2][1]);	// 3
 248:	e51b3008 	ldr	r3, [fp, #-8]            ; pz
 24c:	e2833010 	add	r3, r3, #16              ; r3 = pz + 16
 250:	e5933004 	ldr	r3, [r3, #4]             ; r3 = pz[2][1]
 254:	e1a01003 	mov	r1, r3
 258:	e59f004c 	ldr	r0, [pc, #76]	; 2ac <array_point+0x164>
 25c:	ebfffffe 	bl	0 <printf>
	printf(" *(*(pz + 2) + 1) = %d\n", 		* ( * (pz + 2) + 1) );	// 3
 260:	e51b3008 	ldr	r3, [fp, #-8]                            ; pz
 264:	e2833014 	add	r3, r3, #20                              ; r3 = pz + 20
 268:	e5933000 	ldr	r3, [r3]                                 ; r3 = [pz+20]
 26c:	e1a01003 	mov	r1, r3
 270:	e59f0038 	ldr	r0, [pc, #56]	; 2b0 <array_point+0x168>
 274:	ebfffffe 	bl	0 <printf>

	return 0;
 278:	e3a03000 	mov	r3, #0

}
 27c:	e1a00003 	mov	r0, r3
 280:	e24bd004 	sub	sp, fp, #4
 284:	e8bd8800 	pop	{fp, pc}
 288:	00000100 	.word	0x00000100
 28c:	00000120 	.word	0x00000120
 290:	00000134 	.word	0x00000134
 294:	0000014c 	.word	0x0000014c
 298:	0000016c 	.word	0x0000016c
 29c:	00000188 	.word	0x00000188
 2a0:	00000198 	.word	0x00000198
 2a4:	000001a8 	.word	0x000001a8
 2a8:	000001b8 	.word	0x000001b8
 2ac:	000001c4 	.word	0x000001c4
 2b0:	000001d4 	.word	0x000001d4

000002b4 <evaluate>:

void evaluate()
{
 2b4:	e52db004 	push	{fp}		; (str fp, [sp, #-4]!)
 2b8:	e28db000 	add	fp, sp, #0
 2bc:	e24dd044 	sub	sp, sp, #68	; 0x44
	int ar1[2][3];
	int ar2[3][2];
	
	int **p2;

	pt = &ar1[0][0];
 2c0:	e24b3028 	sub	r3, fp, #40	; 0x28  ar1
 2c4:	e50b3010 	str	r3, [fp, #-16] ;    pt
	pt = ar1[0];
 2c8:	e24b3028 	sub	r3, fp, #40	; 0x28  ar1
 2cc:	e50b3010 	str	r3, [fp, #-16] ;    pt
	pt = ar1;	// warning: assignment from incompatible pointer type
 2d0:	e24b3028 	sub	r3, fp, #40	; 0x28  ar1
 2d4:	e50b3010 	str	r3, [fp, #-16] ;    pt
	
	pa = ar1;
 2d8:	e24b3028 	sub	r3, fp, #40	; 0x28  ar1
 2dc:	e50b3008 	str	r3, [fp, #-8] ;     pa
	pa = ar2;	// warning: assignment from incompatible pointer type
 2e0:	e24b3040 	sub	r3, fp, #64	; 0x40  ar2
 2e4:	e50b3008 	str	r3, [fp, #-8] ;     pa
	
	p2 = &pt;
 2e8:	e24b3010 	sub	r3, fp, #16 ;       pt
 2ec:	e50b300c 	str	r3, [fp, #-12] ;    p2
	*p2 = ar1[0];
 2f0:	e51b300c 	ldr	r3, [fp, #-12] ;    r3 = p2
 2f4:	e24b2028 	sub	r2, fp, #40	; 0x28  r2 = ar1
 2f8:	e5832000 	str	r2, [r3]    ;       *p2 = ar1
	*p2 = ar2[0];
 2fc:	e51b300c 	ldr	r3, [fp, #-12] ;    r3 = p2
 300:	e24b2040 	sub	r2, fp, #64	; 0x40  ar2
 304:	e5832000 	str	r2, [r3]    ;       *p2 = ar2[0]
	p2 = ar2;	// warning: assignment from incompatible pointer type
 308:	e24b3040 	sub	r3, fp, #64	; 0x40  r3 = ar2
 30c:	e50b300c 	str	r3, [fp, #-12] ;    p2 = ar2
}
 310:	e24bd000 	sub	sp, fp, #0
 314:	e49db004 	pop	{fp}		; (ldr fp, [sp], #4)
 318:	e12fff1e 	bx	lr

0000031c <_tmain>:
	指针的指针           char **c;								char **c;               不改变

*/

int _tmain(int argc, char * argv[]) 
{     
 31c:	e92d4800 	push	{fp, lr}
 320:	e28db004 	add	fp, sp, #4
 324:	e24dd068 	sub	sp, sp, #104	; 0x68
 328:	e50b0068 	str	r0, [fp, #-104]	; 0xffffff98    argc
 32c:	e50b106c 	str	r1, [fp, #-108]	; 0xffffff94    argv
	
	int * ptr;     
	
	// ptr1是一个指向 int [3] 的指针，即ptr的类型和&arr1的类型是一样的，注意：arr1指向的内存区域定长     

	int ptr1[3][3] = {{1,2,3},{1,2,3},{1,2,3}};     
 330:	e59f305c 	ldr	r3, [pc, #92]	; 394 <_tmain+0x78>
 334:	e24bc054 	sub	ip, fp, #84	; 0x54      ptr1
 338:	e1a0e003 	mov	lr, r3
 33c:	e8be000f 	ldm	lr!, {r0, r1, r2, r3}
 340:	e8ac000f 	stmia	ip!, {r0, r1, r2, r3}
 344:	e8be000f 	ldm	lr!, {r0, r1, r2, r3}
 348:	e8ac000f 	stmia	ip!, {r0, r1, r2, r3}
 34c:	e59e3000 	ldr	r3, [lr]
 350:	e58c3000 	str	r3, [ip]

	
	// ptr2是一个指向 int * 的指针，即ptr2的类型和&ptr是一样的，注意：ptr指向的内存区域不定长    
	
	int * ptr2[3] = {arr1,arr2,arr3};     
 354:	e24b3018 	sub	r3, fp, #24 ;                   r3 = aar1
 358:	e50b3060 	str	r3, [fp, #-96]	; 0xffffffa0    ptr2[0]
 35c:	e24b3024 	sub	r3, fp, #36	; 0x24              r3 = aar2
 360:	e50b305c 	str	r3, [fp, #-92]	; 0xffffffa4    ptr2[1]
 364:	e24b3030 	sub	r3, fp, #48	; 0x30              aar3
 368:	e50b3058 	str	r3, [fp, #-88]	; 0xffffffa8    ptr2[2]
	

	// ptr3是一个指向 int [3] 的指针，即ptr3的类型和&arr1的类型是一样的，注意：arr1指向的内存区域定长  
	
	int(* ptr3)[3] = &arr1;     ptr3=ptr1; // 没错，他们的类型相同  
 36c:	e24b3018 	sub	r3, fp, #24 ;       aar1
 370:	e50b3008 	str	r3, [fp, #-8] ;     ptr3 = &arr1
 374:	e24b3054 	sub	r3, fp, #84	; 0x54  ptr1
 378:	e50b3008 	str	r3, [fp, #-8] ;     ptr3 = ptr1
	// ptr4是一个指向 int * 的指针，即ptr4的类型和&ptr是一样的，注意：ptr指向的内存区域不定长  
	
	int ** ptr4;     //ptr4 = &arr1; //error 无法从“int (*)[3]”转换为“int **    
	

	ptr4 = ptr2; // 没错，他们的类型相同  
 37c:	e24b3060 	sub	r3, fp, #96	; 0x60  ptr2
 380:	e50b300c 	str	r3, [fp, #-12] ;    ptr4 = ptr2
	
	// ptr4 = ptr3; // error 无法从“int (*)[3]”转换为“int **     
	
	return 0; 
 384:	e3a03000 	mov	r3, #0
}
 388:	e1a00003 	mov	r0, r3
 38c:	e24bd004 	sub	sp, fp, #4
 390:	e8bd8800 	pop	{fp, pc}
 394:	000001ec 	.word	0x000001ec

00000398 <main>:

int main()
{
 398:	e92d4800 	push	{fp, lr}
 39c:	e28db004 	add	fp, sp, #4
	//array();
	array_point();
 3a0:	ebfffffe 	bl	148 <array_point>
	
	return 0;
 3a4:	e3a03000 	mov	r3, #0
}
 3a8:	e1a00003 	mov	r0, r3
 3ac:	e8bd8800 	pop	{fp, pc}
